from django.conf.urls.defaults import *
from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^resources/(?P<path>.*)$','django.views.static.serve',{'document_root': settings.MEDIA_ROOT,'show_indexes': True}),
    (r'^data/(?P<path>.*)$','django.views.static.serve',{'document_root': settings.TORQUE['download_path'],'show_indexes':True}),
    (r'^$','torque.interface.views.index'),
    (r'^j/torrents/index/?$','torque.api.json.views.torrents'),
    (r'^j/torrents/config/get/?$','torque.api.json.views.getConfig'),
    (r'^j/torrents/add/?$','torque.api.json.views.add'),
    (r'^j/torrents/check/?$','torque.torrent.views.check'),
	(r'^j/torrents/start/?$','torque.api.json.views.start'),
	(r'^j/torrents/pause/?$','torque.api.json.views.pause'),
	(r'^j/torrents/remove/?$','torque.api.json.views.remove'),
	(r'^j/torrents/options/get/?$','torque.api.json.views.getOptions'),
	(r'^j/torrents/options/set/?$','torque.api.json.views.setOptions'),
	(r'^j/torrents/details/?$','torque.api.json.views.getDetails'),
    (r'^torrents/upload/?$','torque.torrent.views.upload'),
    (r'^j/files/torrent/details/?$','torque.torrent.views.details'),
    (r'^j/files/index/?$','torque.api.json.views.localFiles'),
    (r'^j/torque/stats/?$','torque.api.json.views.status'),
	(r'^j/torrents/recheck/(?P<hash>[A-Za-z0-9]+)/?$','torque.api.json.views.recheck'),
	(r'^j/torrents/logs/(?P<hash>[A-Za-z0-9]+)/?$','torque.api.json.views.logs'),
    (r'^j/torrents/files/(?P<hash>[A-Za-z0-9]+)/?$','torque.api.json.views.files'),
    (r'^j/torrents/trackers/(?P<hash>[A-Za-z0-9]+)/?$','torque.api.json.views.trackers'),
    (r'^j/torrents/peers/(?P<hash>[A-Za-z0-9]+)/?$','torque.api.json.views.peers'),
    (r'^j/torrents/comments/add/?$','torque.api.json.views.comments_add'),
    (r'^j/torrents/comments/remove/(?P<id>\d+)/?$','torque.api.json.views.comments_delete'),
    (r'^j/torrents/comments/index/(?P<hash>[A-Za-z0-9]+)/?$','torque.api.json.views.comments'),
    #(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^accounts/login/$', 'django.contrib.auth.views.login'),
    (r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
    (r'^debug/cl2db/$','torque.api.json.views.client2database'),
    (r'^admin/', include(admin.site.urls)),
)
